{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}

{% block content %}
  <div class="row">
    <div class="col col-12 col-md-6">
      <div class="card">
        <h2 class="card-header">{% trans "Tunnel Termination" %}</h2>
        <table class="table table-hover attr-table">
          <tr>
            <th scope="row">{% trans "Tunnel" %}</th>
            <td>{{ object.tunnel|linkify }}</td>
          </tr>
          <tr>
            <th scope="row">{% trans "Role" %}</th>
            <td>{% badge object.get_role_display bg_color=object.get_role_color %}</td>
          </tr>
          <tr>
            <th scope="row">
              {% if object.termination.device %}
                {% trans "Device" %}
              {% elif object.termination.virtual_machine %}
                {% trans "Virtual Machine" %}
              {% endif %}
            </th>
            <td>{{ object.termination.parent_object|linkify }}</td>
          </tr>
          <tr>
            <th scope="row">{% trans "Interface" %}</th>
            <td>{{ object.termination|linkify }}</td>
          </tr>
          <tr>
            <th scope="row">{% trans "Outside IP" %}</th>
            <td>{{ object.outside_ip|linkify|placeholder }}</td>
          </tr>
        </table>
      </div>
      {% plugin_left_page object %}
    </div>
    <div class="col col-12 col-md-6">
      {% include 'inc/panels/custom_fields.html' %}
      {% include 'inc/panels/tags.html' %}
      {% plugin_right_page object %}
    </div>
  </div>
  <div class="row">
    <div class="col col-md-12">
      <div class="card">
        <h2 class="card-header">{% trans "Peer Terminations" %}</h2>
        {% htmx_table 'vpn:tunneltermination_list' tunnel_id=object.tunnel.pk id__n=object.pk %}
      </div>
      {% plugin_full_width_page object %}
    </div>
  </div>
{% endblock %}
